﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CompanyBussiness;

namespace Website.customer.Control
{
    public partial class cAdvantageSearch : System.Web.UI.UserControl
    {
        string key = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            key = Request["key"];

            txtkeyword.Text = key;
        }

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            if (txtkeyword.Text != string.Empty)
            {
                if (radProduct.Checked == true)
                {
                    //toi trang Product voi ten san pham
                    //Response.Redirect("Products.aspx?" + CONST.QUERYSTRING_NAME_PRODUCT + "=" + key + "&Mod=MPRODUCT");
                    Response.Redirect("~/Hem/san-pham-dich-vu/" + key + "_" + "MPRODUCT" + ".html");
                }
                else
                {
                    //toi trang tin tuc voi tieu den tin
                    //Response.Redirect("Newsroom.aspx?" + CONST.QUERYSTRING_SUBJECT_NEWS + "=" + key + "&Mod=MNEWS");
                    Response.Redirect("~/Hem/tin-tuc/" + key + "_" + "MNEWS" + ".html");
                }
            }
            else
            {
                lbError.Text = "*";
            }

            
        }
    }
}